package com.daocheng.dc.book.oss.biz.service.impl;

import com.daocheng.dc.book.oss.biz.service.FileService;
import com.daocheng.dc.book.oss.biz.strategy.FileStrategy;
import com.daocheng.framework.common.response.Response;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

/**
 * @ClassName FileServiceImpl
 * @author: 稻城
 * @date: 2025/3/25
 * @Version 1.0
 * @description: TODO
 */
@Service
@Slf4j
public class FileServiceImpl implements FileService {
    @Resource
    FileStrategy fileStrategy;
    @Override
    public Response<?> uploadFile(MultipartFile file) {
        String url = fileStrategy.uploadFile(file,"dc-book");
        return Response.success(url);
    }
}
